package test;

import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.JComponent;
import javax.swing.JTextField;

public class MyComponent extends JComponent {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -8640000559762563915L;

	public String desc;
	
	public Component component;
	
	public MyComponent () {
		
		this.setPreferredSize(new Dimension(60, 60));
		desc = "mycomponent";
		component = new JTextField(10);
	}

	@Override
	public void paintComponent(Graphics g) {
		g.drawString(desc, 20, 20);
//		component.paint(g);
//		super.paintComponent(g);
	}

	@Override
	public void paint(Graphics g) {
		g.drawString(desc, 100, 100);
//		super.paint(g);
	}
	
	
	
	

}
